package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZcOrdersMapper;
import com.ruoyi.system.domain.ZcOrders;
import com.ruoyi.system.service.IZcOrdersService;
import com.ruoyi.common.core.text.Convert;

/**
 * 租车订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-03
 */
@Service
public class ZcOrdersServiceImpl implements IZcOrdersService 
{
    @Autowired
    private ZcOrdersMapper zcOrdersMapper;

    /**
     * 查询租车订单
     * 
     * @param orderId 租车订单主键
     * @return 租车订单
     */
    @Override
    public ZcOrders selectZcOrdersByOrderId(Long orderId)
    {
        return zcOrdersMapper.selectZcOrdersByOrderId(orderId);
    }

    /**
     * 查询租车订单列表
     * 
     * @param zcOrders 租车订单
     * @return 租车订单
     */
    @Override
    public List<ZcOrders> selectZcOrdersList(ZcOrders zcOrders)
    {
        return zcOrdersMapper.selectZcOrdersList(zcOrders);
    }

    /**
     * 新增租车订单
     * 
     * @param zcOrders 租车订单
     * @return 结果
     */
    @Override
    public int insertZcOrders(ZcOrders zcOrders)
    {
        zcOrders.setCreateTime(DateUtils.getNowDate());
        return zcOrdersMapper.insertZcOrders(zcOrders);
    }

    /**
     * 修改租车订单
     * 
     * @param zcOrders 租车订单
     * @return 结果
     */
    @Override
    public int updateZcOrders(ZcOrders zcOrders)
    {
        return zcOrdersMapper.updateZcOrders(zcOrders);
    }

    /**
     * 批量删除租车订单
     * 
     * @param orderIds 需要删除的租车订单主键
     * @return 结果
     */
    @Override
    public int deleteZcOrdersByOrderIds(String orderIds)
    {
        return zcOrdersMapper.deleteZcOrdersByOrderIds(Convert.toStrArray(orderIds));
    }

    /**
     * 删除租车订单信息
     * 
     * @param orderId 租车订单主键
     * @return 结果
     */
    @Override
    public int deleteZcOrdersByOrderId(Long orderId)
    {
        return zcOrdersMapper.deleteZcOrdersByOrderId(orderId);
    }

    @Override
    public List<Map<String, Object>> selectByOrderId(Long orderId) {
        return zcOrdersMapper.selectByOrderId(orderId);
    }
}
